package com.eric.rabbitmq.object;

import com.eric.rabbitmq.bean.User;
import com.eric.rabbitmq.config.RabbitSimpleConfig;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author chenw-i
 * @version 1.0.0
 * @ClassName ObjSender.java
 * @Description TODO
 * @createTime 2020年07月29日 17:04:00
 */
@Component
public class ObjSender {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void sendObj(User user){
        rabbitTemplate.convertAndSend(RabbitSimpleConfig.QUEUE_OBJECT,user);
        System.out.println("send user : "+user);
    }
}
